package homework;

import java.util.ArrayList;

public class work08 {

	public static void main(String[] args) {
		maxLen("zvbzzf");
		maxLen("zahdsab");
		maxLen("zzzzzf");
		maxLen("abcdefg");
		maxLen("aaaaaaaa");
		maxLen("b");
	}
	
	public static void maxLen(String max){
		int a = 0;
		ArrayList<Character> list = new ArrayList<Character>();
		for(int i = 0;i<max.length() && a+i < max.length();i++){
			for(int j = i;j<max.length();j++){
				if(list.contains(max.charAt(j))){				
					break;					
				}else{
					list.add(max.charAt(j));
				}
			}
			if(a<list.size()){
				a = list.size();
			}			
			list.clear();			
		}
		System.out.println(a);
	}

}
